﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Principal.Master" AutoEventWireup="true" CodeBehind="frmRecorridos.aspx.cs" Inherits="EncuentraWEB.Formulario_web15" %>






<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script language="JavaScript" type="text/javascript">
<!--    //BEGIN Script

    function new_window(url) {
        var ventana = window.showModalDialog(url, "width=300, height=100");
        var btn = document.getElementById("ctl00_ContentPlaceHolder1_Button4");
        if (btn) {
            btn.click();
        }
    }

    function CheckOtherIsCheckedByGVID(spanChk) {
        var Parent = document.getElementById("ctl00_ContentPlaceHolder1_grdEmpresas");
        var hidColor = document.getElementById("ctl00_ContentPlaceHolder1_hidColor");
        var hidLetra = document.getElementById("ctl00_ContentPlaceHolder1_hidLetra");
        var hidIndice = document.getElementById("ctl00_ContentPlaceHolder1_hidIndice");
        var items = Parent.getElementsByTagName('input');



        var CurrentRdbID = spanChk.id;

        //spanChk.parentElement.parentElement.style.backgroundColor
        //var anteriorLetra = spanChk.parentElement.parentElement.style.backgroundColor
        //spanChk.parentElement.parentElement.style.backgroundColor = '#738A9C';

        //spanChk.parentElement.parentElement.style.color = 'white';

        for (i = 0; i < items.length; i++) {

            if (items[i].id != CurrentRdbID && items[i].type == "radio") {

                if (items[i].checked) {

                    items[i].checked = false;

                    items[i].parentElement.parentElement.style.backgroundColor = hidLetra.value;

                    items[i].parentElement.parentElement.style.color = hidColor.value;
                }

            }
            else {
                if (items[i].id == CurrentRdbID) hidIndice.value = i;
            }


        }


        var IsChecked = spanChk.checked;

        if (IsChecked) {
            var back = spanChk.parentElement.parentElement.style.backgroundColor;
            if (back != '#738a9c') {
                hidColor.value = spanChk.parentElement.parentElement.style.color;
                hidLetra.value = spanChk.parentElement.parentElement.style.backgroundColor;
            }
            spanChk.parentElement.parentElement.style.backgroundColor = '#738A9C';
            spanChk.parentElement.parentElement.style.color = 'white';

        }
        var Chk = spanChk;



    }






    function eliminar() {
        var hid = document.getElementById("ctl00_ContentPlaceHolder1_hidResultado");
        var res = window.confirm("Esta seguro que desea eliminar este registro?");
        if (res) hid.value = "true";
        var btn = document.getElementById("ctl00_ContentPlaceHolder1_Button6");
        if (btn) {
            btn.click();
        }


    }
    function cambiar() {
        var hid = document.getElementById("ctl00_ContentPlaceHolder1_hidResultado");
        hid.value = "false";
    }






//END Script-->
    </script>
    <table style="width: 100%">
        <tr>
            <td class="Separador" colspan="3">
                        <asp:ImageButton ID="btnImgFiltrar" runat="server" ImageUrl="~/Imagenes/Botones/BotonFiltrar.gif"
                            OnClick="btnImgFiltrar_Click" />
                <asp:HiddenField ID="hidResultado" runat="server" Value="false" />
                <asp:HiddenField ID="hidIndice" runat="server" />
                <asp:HiddenField ID="hidColor" runat="server" />
                <asp:HiddenField ID="hidLetra" runat="server" />
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <table style="width: 100%; height: 32px;">
                    <tr>
                        <td class="style7">
                            <asp:Label ID="Label1" runat="server" CssClass="labelVentana" Text="Línea:"></asp:Label>
                        </td>
                        <td class="style8">
                            <asp:DropDownList ID="DropLinea" runat="server">
                            </asp:DropDownList>
                        </td>
                        <td class="style8">
                            </td>
                    </tr>
                    </table>
            </td>
            <td >
            </td>
        </tr>
        <tr>
            <td class="Separador" colspan="3">
                        <asp:ImageButton ID="btnImgAgregar" runat="server" CssClass="Boton" ImageUrl="~/Imagenes/Botones/BotonAgregar.gif"
                            OnClick="ImageButton1_Click" ToolTip="AGREGAR" />
                        <asp:ImageButton ID="btnImgEditar" runat="server" CssClass="Boton" ImageUrl="~/Imagenes/Botones/BotonEditar.gif"
                            OnClick="btnImgEditar_Click" />
                        <asp:ImageButton ID="ImageButton2" runat="server" CssClass="Boton" ImageUrl="~/Imagenes/Botones/BOTONVer.gif"
                            OnClick="ImageButton2_Click" />
                        <asp:ImageButton ID="ImageButton3" runat="server" CssClass="Boton" ImageUrl="~/Imagenes/Botones/BotonEliminar.gif"
                            OnClick="ImageButton3_Click" />
            </td>
        </tr>
        <tr>
            <td style="width: 10%">
                &nbsp;</td>
            <td >

                            <asp:GridView ID="grdEmpresas" runat="server" BackColor="White" BorderColor="#E7E7FF"
                                BorderStyle="None" BorderWidth="1px" CellPadding="4" 
                                GridLines="Horizontal" Height="250px"
                                Style="margin-left: 0px" Width="848px" Font-Names="Arial" Font-Size="Medium"
                                AllowPaging="True" OnPageIndexChanging="grdEmpresas_PageIndexChanging" AutoGenerateColumns="False"
                                EmptyDataText="No se encuentra registros" onselectedindexchanged="grdEmpresas_SelectedIndexChanged" 
                               >
                                <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                                <Columns>
                                    <asp:TemplateField HeaderText="">
                                        <ItemTemplate>
                                            <asp:RadioButton ID="rdbGVRow" onclick="javascript:CheckOtherIsCheckedByGVID(this);"
                                                runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="intIdRecorrido" HeaderText="Id Recorridos" 
                                        NullDisplayText="-" />
                                    <asp:BoundField DataField="fecFechaEstado"  HeaderText="Fecha Estado"
                                        NullDisplayText="     " />
                                    <asp:BoundField DataField="intIdEstado"  HeaderText="Estado" 
                                        NullDisplayText="     " />
                                    
                                </Columns>
                                <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                                <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" 
                                    Wrap="True" />
                                <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                                <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" 
                                    Height="35px" />
                                <AlternatingRowStyle BackColor="#F7F7F7" />
                            </asp:GridView>

                    </td>
            <td style="width: 10%">
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <table style="width: 100%; height: 39px;">
        <tr>
            <td>
                <asp:Label ID="Label3" runat="server" Text="ACTUALIZACÍON DE DATOS DE RECORRIDO" CssClass="Titulos"></asp:Label>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content4" runat="server" contentplaceholderid="head">

    <style type="text/css">
        .style6
        {
            width: 125px;
        }
        .style7
        {
            width: 5%;
            height: 7px;
        }
        .style8
        {
            height: 7px;
        }
    </style>

</asp:Content>

